From d74e1b9ac9cb349511902d3543880fb14de7a098 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Mon, 17 Sep 2012 11:34:54 +0200 Subject: [PATCH] stylecontext: Always create animations Even when there is no current values, do create animations. This ensures that animations do exist for unmapped widgets when they get mapped later. --- gtk/gtkstylecontext.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/gtk/gtkstylecontext.c b/gtk/gtkstylecontext.c index b06d4d868d..e5d416f5be 100644 --- a/gtk/gtkstylecontext.c +++ b/gtk/gtkstylecontext.c @@ -3147,6 +3147,8 @@ _gtk_style_context_validate (GtkStyleContext *context, if (current == NULL || gtk_style_context_needs_full_revalidate (context, change)) { + StyleData *data; + if ((priv->relevant_changes & change) & ~GTK_STYLE_CONTEXT_CACHED_CHANGE) { gtk_style_context_clear_cache (context); @@ -3157,22 +3159,20 @@ _gtk_style_context_validate (GtkStyleContext *context, style_info_set_data (info, NULL); } - if (current) - { - StyleData *data; - - data = style_data_lookup (context); + data = style_data_lookup (context); - _gtk_css_computed_values_create_animations (data->store, - timestamp, - gtk_style_context_should_create_transitions (context) ? current->store : NULL, - context); - if (_gtk_css_computed_values_is_static (data->store)) - change &= ~GTK_CSS_CHANGE_ANIMATE; - else - change |= GTK_CSS_CHANGE_ANIMATE; - _gtk_style_context_update_animating (context); + _gtk_css_computed_values_create_animations (data->store, + timestamp, + current && gtk_style_context_should_create_transitions (context) ? current->store : NULL, + context); + if (_gtk_css_computed_values_is_static (data->store)) + change &= ~GTK_CSS_CHANGE_ANIMATE; + else + change |= GTK_CSS_CHANGE_ANIMATE; + _gtk_style_context_update_animating (context); + if (current) + { changes = _gtk_css_computed_values_get_difference (data->store, current->store); /* In the case where we keep the cache, we want unanimated values */ -- 2.30.2